/**
 * @description 定义全局路由表及路由类型
 */

import { AnimateEnum, AnimateClassEnum as ACE } from '@/enum'

type RouteType<T = AnimateEnum> = {
    path: string
    name: string
    component: () => Promise<any>
    meta: {
        isKeepAlive?: boolean
        leaveMode?: T
        insideMode?: T
        animatClass?: ACE
    }
}

const Route: Array<RouteType> = [
    {
        path: '/',
        name: 'index',
        component: () => import('@/page/index.vue'),
        meta: {
            leaveMode: AnimateEnum.SlideIn,
            insideMode: AnimateEnum.SlideOut,
            animatClass: ACE.FADE,
            isKeepAlive: true
        }
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/page/login.vue'),
        meta: {
            isKeepAlive: true
        }
    },
    {
        path: '/detail',
        name: 'detail',
        component: () => import('@/page/detail.vue'),
        meta: {}
    }
]

export default Route